package com.mystore.dao;


import com.mystore.entity.Order;
import com.mystore.vo.OrderVO;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface OrderDao {

    /**
     * 通过用户id查找所有的订单信息
     * @param uid
     * @param connection
     * @return
     */
    List<OrderVO> findAllOrderByUid(int uid, Connection connection);


    /**
     * 保存用户订单
     * @param order
     * @param connection
     * @return
     * @throws SQLException
     */
    Boolean save(Order order, Connection connection) throws SQLException;


    /**
     * 更新订单状态
     * @param order
     * @param connection
     * @return
     * @throws SQLException
     */
    Boolean updateOrder(Order order, Connection connection) throws SQLException;

    /**
     * 通过订单id和用户id查找订单详情
     * @param oid
     * @param uid
     * @param connection
     * @return
     */
    OrderVO findOneOrderByOidAndUid(int oid,int uid,Connection connection);

}
